package com.yzq.enums;

import lombok.Getter;

@Getter
public enum PictureReviewStatus {
    UNREVIEWED(0, "待审核"),
    REVIEWED(1, "审核通过"),
    REJECTED(2, "审核拒绝");

    private final Integer code;
    private final String message;

    PictureReviewStatus(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static String getMessageByCode(Integer code) {
        for (PictureReviewStatus value : PictureReviewStatus.values()) {
            if (value.getCode().equals(code)) {
                return value.getMessage();
            }
        }
        return null;
    }

    public static PictureReviewStatus getByCode(Integer code) {
        for (PictureReviewStatus value : PictureReviewStatus.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
